<template>
  <div class="exercise-box" style="margin-top: 10px;">
    <div class="exercise-option-lis" style="margin-bottom: 5px;" v-for="count in number" :key="count">
        <span style="line-height: 32px;display: inline-block;vertical-align: top;width:50px;margin-right: 5px">填空{{count}}:</span>
        <a-textarea v-if="answerList[count-1]" disabled v-model="answerList[count-1].Content" placeholder="请输入答案" style="width:calc(100% - 55px);" auto-size />
        <a-textarea v-else disabled placeholder="请输入答案" style="width:calc(100% - 55px);" auto-size />
        <div v-if="answerList[count-1]" class="Ti-pdf-input" style="line-height: 32px;width: calc(100% - 75px);">{{answerList[count-1].Content}}</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      Alphabet: [
        'A',
        'B',
        'C',
        'D',
        'E',
        'F',
        'G',
        'H',
        'I',
        'J',
        'K',
        'L',
        'M',
        'N',
        'O',
        'P',
        'Q',
        'R',
        'S',
        'T',
        'U',
        'V',
        'W',
        'X',
        'Y',
        'Z'
      ],
      answerList: []
    };
  },
  props: {
    data: {
      type: Object,
      default: () => {}
    },
    index: {
        type: Number,
        default: 0
    },
    showAnswer: {
      type: Boolean,
      default: false
    }
  },
  computed:{
    number(){
      return this.data.AnswerList[this.data.AnswerList.length-1].SortOrder+1
    }
  },
  mounted() {
    this.setStuAnswerShow()
  },
  methods: {
    setStuAnswerShow() {
      var StuFillAnswer = '';
      if (this.data.StuAnswer) {
        StuFillAnswer = JSON.parse(this.data.StuAnswer);
      }
        this.answerList = StuFillAnswer;
    }
  }
};
</script>

<style>
</style>